from django.db import models

# Create your models here.

# B
# class Guan(models.Model):
#     name = models.CharField(max_length=100)
#     password = models.CharField(max_length=1000)
#
#     class Meta:
#         db_table='guan'
#         verbose_name='管理人员'
#         verbose_name_plural=verbose_name
# class


# A
class Me(models.Model):
    username = models.CharField(max_length=100)
    password = models.CharField(max_length=1000)

    class Meta:
        db_table='me'
        verbose_name='用户'
        verbose_name_plural=verbose_name

class School(models.Model):
    name = models.CharField(max_length=100)

class Sclass(models.Model):
    name = models.CharField(max_length=1000)
    content = models.CharField(max_length=100)
    school = models.ForeignKey(School,on_delete=models.CASCADE)

class Student(models.Model):
    name = models.CharField(max_length=100)
    school = models.ForeignKey(School,on_delete=models.CASCADE)
    sclass = models.ForeignKey(Sclass,on_delete=models.CASCADE)
    user = models.ForeignKey(Me,on_delete=models.CASCADE)

